package com.xoa.service.crm;


import com.xoa.model.crm.Supplier;
import com.xoa.util.ToJson;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;

public interface SupplierService {


    /*
    模糊查询   分页  查询所有
    * */
    List<Supplier> selectByCondition(Integer page, Integer pageSize, Boolean useFlag, Map map);


    /**
     * 添加一条供应商数据
     * @param supplier
     * @return
     */
    int insert(Supplier supplier);

    /**
     * 数据回显
     * @param supplierId
     * @return
     */
    Supplier selectByPrimaryKey(Integer supplierId);

    /**
     * 修改供应商数据
     * @param supplier
     * @return
     */
    int  updateByPrimaryKey(Supplier supplier);


    /**
     * 删除一条数据
     * @param supplierId
     * @return
     */
    int deleteByPrimaryKey(Integer supplierId);

    /**
     * 导出功能
     * @param request
     * @param response
     * @return
     */
    ToJson<Supplier> supplierExport(HttpServletRequest request, HttpServletResponse response);

    /**
     * 导入功能
     * @param request
     * @param response
     * @param file
     * @return
     */
    ToJson<Supplier> insertImport(HttpServletRequest request, HttpServletResponse response, MultipartFile file);
}
